package com.spring.demo12.eg2;

import org.springframework.context.event.ApplicationEventMulticaster;

/**
 * @author vhans
 */
public class OrderCreateService {
    private ApplicationEventMulticaster eventMulticaster;

    public void orderCreate(Long orderId) {
        System.out.printf("创建订单，订单编号为「%s」\n", orderId);
        this.eventMulticaster.multicastEvent(new OrderCreateEvent(this, orderId), null);
    }

    public ApplicationEventMulticaster getEventMulticaster() {
        return eventMulticaster;
    }

    public void setEventMulticaster(ApplicationEventMulticaster eventMulticaster) {
        this.eventMulticaster = eventMulticaster;
    }
}
